package com.feidee.data.report.model;

import com.feidee.data.report.util.ToolUtils;

/**
 * 报表配置
 *
 * @author Admin
 */
public class ReportConfiguration {
	/**
	 * 报表名称
	 */
	private String report_key;
	/**
	 * 报表sql索引
	 */
	private String report_index;
	/**
	 * 报表hql内容
	 */
	private String hqlcontext;
	/**
	 * 报表sql内容
	 */
	private String sqlcontext;
	/**
	 * 报表对应运行时间,0-6表示星期一(1)到星期天(0),7表示每天执行,多天用,分隔(1,2,3)
	 */
	private String run_date;
	/**
	 * 'hql操作类型，默认是select操作
	 */
	private String operation = "select";
	/**
	 * hql执行引擎，默认为hive
	 */
	private String engine = "hive";
	/**
	 * 扩展操作类名
	 */
	private String process_class;

	/**
	 * 插入mysql数据库的表的类型,horizontal为横表,vertical为纵表
	 */
	private String table_type = "horizontal";

	/**
	 * 插入mysql数据库中的表的名字
	 */
	private String mysql_table;

	/**
	 * 插入mysql数据库中的表的维度
	 */
	private String mysql_keys;

	/**
	 * 是否为自定义报表
	 */
	private String isCustom;

	/**
	 * 历史sql[仅在拼接Mysql缓存结果时使用]
	 */
	private String sqlHistory;

	/**
	 * 发布状态[仅在拼接Mysql缓存结果时使用]
	 */
	private String isEnable;

	/**
	 * 报表依赖
	 */
	private String reportDependency;

	/**
	 * 若为start,则表示加入到执行队列的时间,如果Exception或Success,则为开始执行时间
	 */
	private long enqueueTime;

	/**
	 * 是否是执行历史SQL标识
	 */
	private String runHistory;

	/**
	 * 报表运行优先级
	 */
	private int runPriority;

	/**
	 * 报表优先级
	 */
	private int tablePriority;

	/**
	 * 是否是数据源调度
	 */
	private String isScheduler;

	/**
	 * 数据源依赖
	 */
	private String dataResources;

	public ReportConfiguration(String report_key, String report_index, String hqlcontext, String sqlcontext,
			String run_date, String operation, String engine, String process_class) {
		this.report_key = report_key;
		this.report_index = report_index;
		this.hqlcontext = hqlcontext;
		this.sqlcontext = sqlcontext;
		this.run_date = run_date;
		this.operation = operation;
		this.engine = engine;
		this.process_class = process_class;
	}

	public ReportConfiguration() { }

	public String getReport_key() {
		return report_key;
	}

	public void setReport_key(String report_key) {
		this.report_key = report_key;
	}

	public String getReport_index() {
		return report_index;
	}

	public void setReport_index(String report_index) {
		this.report_index = report_index;
	}

	public String getHqlcontext() {
		return hqlcontext;
	}

	public void setHqlcontext(String hqlcontext) {
		this.hqlcontext = hqlcontext;
	}

	public String getSqlcontext() {
		return sqlcontext;
	}

	public void setSqlcontext(String sqlcontext) {
		this.sqlcontext = sqlcontext;
	}

	public String getRun_date() {
		return run_date;
	}

	public void setRun_date(String run_date) {
		this.run_date = run_date;
	}

	public String getOperation() {
		return operation;
	}

	public void setOperation(String operation) {
		if (ToolUtils.isNotNull(operation))
			this.operation = operation;
	}

	public String getEngine() {
		return engine;
	}

	public void setEngine(String engine) {
		if (ToolUtils.isNotNull(engine))
			this.engine = engine;
	}

	public String getProcess_class() {
		return process_class;
	}

	public void setProcess_class(String process_class) {
		this.process_class = process_class;
	}

	public String getTable_type() {
		return table_type;
	}

	public void setTable_type(String table_type) {
		this.table_type = table_type;
	}

	public String getMysql_table() {
		return mysql_table;
	}

	public void setMysql_table(String mysql_table) {
		this.mysql_table = mysql_table;
	}

	public String getMysql_keys() {
		return mysql_keys;
	}

	public void setMysql_keys(String mysql_keys) {
		this.mysql_keys = mysql_keys;
	}

	public String getIsCustom() {
		return isCustom;
	}

	public void setIsCustom(String isCustom) {
		this.isCustom = isCustom;
	}

	public String getSqlHistory() {
		return sqlHistory;
	}

	public void setSqlHistory(String sqlHistory) {
		this.sqlHistory = sqlHistory;
	}

	public String getIsEnable() {
		return isEnable;
	}

	public void setIsEnable(String isEnable) {
		this.isEnable = isEnable;
	}

	public String getReportDependency() {
		return reportDependency == null ? "" : reportDependency;
	}

	public void setReportDependency(String reportDependency) {
		this.reportDependency = reportDependency;
	}

	public long getEnqueueTime() {
		return enqueueTime;
	}

	public void setEnqueueTime(long enqueueTime) {
		this.enqueueTime = enqueueTime;
	}

	public String getRunHistory() {
		return runHistory == null ? "0" : runHistory;
	}

	public void setRunHistory(String runHistory) {
		this.runHistory = runHistory;
	}

	public int getRunPriority() {
		return runPriority;
	}

	public void setRunPriority(int runPriority) {
		this.runPriority = runPriority;
	}

	public int getTablePriority() {
		return tablePriority;
	}

	public void setTablePriority(int tablePriority) {
		this.tablePriority = tablePriority;
	}

	public String getIsScheduler() {
		return isScheduler;
	}

	public void setIsScheduler(String isScheduler) {
		this.isScheduler = isScheduler;
	}

	public String getDataResources() {
		return dataResources;
	}

	public void setDataResources(String dataResources) {
		this.dataResources = dataResources;
	}
}
